#include "httplib.h"

#define SERVER_IP "43.143.168.246"
#define SERVER_PORT 9090

int main()
{
    httplib::Client client(SERVER_IP,SERVER_PORT);//实例化client对象，用于搭建客户端
    //客户端上传的文件信息
    httplib::MultipartFormData item;
    item.name = "file";
    item.filename = "hello.txt";
    item.content = "Hello World!";//上传文件时，文件内容
    item.content_type = "text/plain";

    //MultipartFormDataItems是vector
    httplib::MultipartFormDataItems items;
    items.push_back(item);

    auto res = client.Post("/multipart",items);//请求完毕，得到响应
    std::cout << res->status << std::endl;
    std::cout << res->body <<std::endl;

    return 0;
}
